UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RI4fuYX9h2hWHKZXrCGBM3bcY4x2rCaIlEBGDDHTHqk=' 
WHERE 
  key_id = '193a3c984a1bd1985364a65e1afc2eb9171b3d3d900330657ba151c308b2b05c' 
  AND (
    token = 'RI4fuYX9h2hWHKZXrCGBM3bcY4x2rCaIlEBGDDHTHqk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039