UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'PbVACZcXhEsmOqabr/RmO7VHXNhh7/kWvKKUOcyiG9s=' 
WHERE 
  key_id = '70d46a40a208865982000c5e826f5499b45237459ffea8495636fc917095e406' 
  AND (
    token = 'PbVACZcXhEsmOqabr/RmO7VHXNhh7/kWvKKUOcyiG9s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00055