UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 's6dKaXMfnlGYQsWpF8y6jxE7XT8B9B3C3gKaYis6xh0='
WHERE
key_id = '179af72f229fe00094163bbda27f1cfabab0d4a55bc4adc1bea4f221f21aed03'
AND (
token = 's6dKaXMfnlGYQsWpF8y6jxE7XT8B9B3C3gKaYis6xh0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)