UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4NiumGgifqMiIBzLwSQrkd1SQgJVkx9EKilHsv1DCpQ=' 
WHERE 
  key_id = '19334d5a6e9580728df4a0e8c4ea79d1e4c6e3f7ab688e94df40e823db1c54b9' 
  AND (
    token = '4NiumGgifqMiIBzLwSQrkd1SQgJVkx9EKilHsv1DCpQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00055