UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fs0xMmh2mfHM0muYo1EamFfjbO34WRdQQ9DGVndY35Y=' 
WHERE 
  key_id = 'b0def976a598c875eaf49f0245aed380df715bb268644041c506a58d03a38546' 
  AND (
    token = 'fs0xMmh2mfHM0muYo1EamFfjbO34WRdQQ9DGVndY35Y=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00071