UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'cfRrJ8Nxmv1/VdyDTr4FevWQTeElQ+IEnTSYN1kHg68=' 
WHERE 
  key_id = 'e1607914c443fe3a370558230372e62a0ac0609e067ce234220ccdcfc1d6b466' 
  AND (
    token = 'cfRrJ8Nxmv1/VdyDTr4FevWQTeElQ+IEnTSYN1kHg68=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025