UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VddYIRGWNSyR4HhF8X4J1G7mB2Sb/LkJKG6G9DHLH9I=' 
WHERE 
  key_id = '70fa0e975ca894752b3fa8c6e435126bf66a43b67ed15743e608193309caac42' 
  AND (
    token = 'VddYIRGWNSyR4HhF8X4J1G7mB2Sb/LkJKG6G9DHLH9I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041