UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Fn9ss9NCI0E+NQBJ9Y8l0L2g2FNvuxkcF2SS1ToEj/Q=' 
WHERE 
  key_id = 'e4a35418f04db21538638d34e8d11ef4718b4c915e1724dd8ee1a5d3daac3051' 
  AND (
    token = 'Fn9ss9NCI0E+NQBJ9Y8l0L2g2FNvuxkcF2SS1ToEj/Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00055