UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'IKLoOhD8XpeLXTneFo1tkKRzi169C+Qljitl3dape4s=' 
WHERE 
  key_id = '2910e2019215ac54fe367fe53f9917f10ce2109e875234560cff2849c09c98a9' 
  AND (
    token = 'IKLoOhD8XpeLXTneFo1tkKRzi169C+Qljitl3dape4s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045