UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '79PsnkMhhk1Toee+6iRWpymLXdQ6w6EhDz73R/bM3do='
WHERE
key_id = '19b4a15616e221fcd7aa2c87415967f5643bdd6ace60e90df1bc45d8839fb7c5'
AND (
token = '79PsnkMhhk1Toee+6iRWpymLXdQ6w6EhDz73R/bM3do='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)