UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fDbUDCr55tVQh5w1R7EZEdl3d9ANFRStLTPyho4cPdQ=' 
WHERE 
  key_id = '2d687e5e1c62c7ce157e673b8811e85b596b9cd9aae4f5ca2bce635c3c8f8aa2' 
  AND (
    token = 'fDbUDCr55tVQh5w1R7EZEdl3d9ANFRStLTPyho4cPdQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025