UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '29hK2ojgX6a6U1/q42vdbIcdmx8WSJ5mlr4EM/ONXFo=' 
WHERE 
  key_id = '43a83bb12879e9e1f5545fb9f284b22d8c85ad1b7cc6c5d2e509f48b14bed0fe' 
  AND (
    token = '29hK2ojgX6a6U1/q42vdbIcdmx8WSJ5mlr4EM/ONXFo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025