UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'NcRHgrMyUeuWSUR2GLT9wP7/wRSiMihT6hAXKQJZPsk='
WHERE
key_id = '40119a22dab58ea3456f08e47d3efe9f836ca8aba135efa7ba794966c2c881ae'
AND (
token = 'NcRHgrMyUeuWSUR2GLT9wP7/wRSiMihT6hAXKQJZPsk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)