UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rlOz80SvhOTJ8+ne498ZWBRVNr6WH6/vOtmbtJMQZhc=' 
WHERE 
  key_id = 'ef679fcd55ad8c254760fa796ab31a9b268b02a6e681da1c630d35131d3dbc13' 
  AND (
    token = 'rlOz80SvhOTJ8+ne498ZWBRVNr6WH6/vOtmbtJMQZhc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022