UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+678+imnU7oxZRtrd+T9ykeEBIGvygmE9UY3AeIyWkQ=' 
WHERE 
  key_id = '2f62dfe3ebadec74522e80bfc028f4dac5198332adb822063d88a4766c6ac691' 
  AND (
    token = '+678+imnU7oxZRtrd+T9ykeEBIGvygmE9UY3AeIyWkQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022