UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fbFxY8qIpPIQGOfgWtNXGUMEMlTLnk9Y77fQzjw/WlY=' 
WHERE 
  key_id = 'f94a4675499ae7f9a7d4086b438c7c427b4cc70f7eb0c8ac3c90765549916bf8' 
  AND (
    token = 'fbFxY8qIpPIQGOfgWtNXGUMEMlTLnk9Y77fQzjw/WlY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028