UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/qIdvKrSbLrvcOJfd1X3FrZlrNubiZ+MIFHfQi6pAWA=' 
WHERE 
  key_id = '329b930e7e847fc97c0982e31437708f705f269f2b4d165b9baf83efdd2ed64d' 
  AND (
    token = '/qIdvKrSbLrvcOJfd1X3FrZlrNubiZ+MIFHfQi6pAWA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029