UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WjLPuQePGpZ8zj0o72yanmNYwxyU/Q6lVDqUMI8RusY=' 
WHERE 
  key_id = '0572b0a17f6069c9ec75e5ff13d307b47b3a5c179556680758414dbf4275ff28' 
  AND (
    token = 'WjLPuQePGpZ8zj0o72yanmNYwxyU/Q6lVDqUMI8RusY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00057