UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GBFQ00aE15EoNZ6s/QirfZyY4SEikwMKWPhahtIeUyk=' 
WHERE 
  key_id = 'c93966ba39d7d7d9100d630a4db06d3d6089dab09213fb08b123d687a05283d0' 
  AND (
    token = 'GBFQ00aE15EoNZ6s/QirfZyY4SEikwMKWPhahtIeUyk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032