UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 't73GINhgj8GCqio1hnh6fLn/kBzK7OdcCamiBw+Ean4=' 
WHERE 
  key_id = '1ffcdebf48a6133aaf424b640f291ccd64819f741ff0a3288dee1d5d3cea1079' 
  AND (
    token = 't73GINhgj8GCqio1hnh6fLn/kBzK7OdcCamiBw+Ean4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037