UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Vf/1fdavzR5xWjmeRhHN1agkArZiBNiBuekXYXUIK50=' 
WHERE 
  key_id = 'd606df33bd2dcf2eb8348c3eed2f7ae4d8763a4b92fcb834f931e012a71e1127' 
  AND (
    token = 'Vf/1fdavzR5xWjmeRhHN1agkArZiBNiBuekXYXUIK50=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035