UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mQoPHKFx/m7zh5Es50PUPfASQbgXpT+HzlaUn2m2+Nw=' 
WHERE 
  key_id = '41441d40ac8655f568c237667562ec4c0d545fe9ad6297728d592ae3bc6fc89c' 
  AND (
    token = 'mQoPHKFx/m7zh5Es50PUPfASQbgXpT+HzlaUn2m2+Nw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027