UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2FL4SnkqbQD07+TiZE0cvslZl12OvjWURP0g+TiMHE8=' 
WHERE 
  key_id = 'b625e4dfdafc78c85eda9fda2d6f6d6732938fca191dd9cbe47b96c6f3bea111' 
  AND (
    token = '2FL4SnkqbQD07+TiZE0cvslZl12OvjWURP0g+TiMHE8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037