UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'OqeZdp0/PKj/+DJlXBx9oRI870dTVrXi4FZG1OimlNk=' 
WHERE 
  key_id = '8d3ee66f603eb1b6e39f3da251c1c735d0e6189e6206df4bfe6c793e96b199a0' 
  AND (
    token = 'OqeZdp0/PKj/+DJlXBx9oRI870dTVrXi4FZG1OimlNk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00054