UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'p1MqK/X0wY4zeuK0hlCUjtt+vcK9aluDOFDoI/+Zqc0=' 
WHERE 
  key_id = '72472f5d1fb745c5c4d1d7dc04b92d7acb90ffb0c5e48c214011e4e80d7ef3d7' 
  AND (
    token = 'p1MqK/X0wY4zeuK0hlCUjtt+vcK9aluDOFDoI/+Zqc0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032