UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'utHvBSis5ZmuNZkMseWbC3dy44fxzsw0n7bVmskKxGQ=' 
WHERE 
  key_id = 'ab5619fb0c0b38e5279128d4ff53b5fc2b72f0b6dd4d8e200cd840a1eb2c025d' 
  AND (
    token = 'utHvBSis5ZmuNZkMseWbC3dy44fxzsw0n7bVmskKxGQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00056