UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nQyVKU70wIHet9Gq2m8ffD4+JAXHGnVm0PxFzF0qMl8=' 
WHERE 
  key_id = 'f8754ca76b2137f5783d01600498b45cad82ddb4de909d6f250b0d9107aa71e3' 
  AND (
    token = 'nQyVKU70wIHet9Gq2m8ffD4+JAXHGnVm0PxFzF0qMl8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028