UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uzIOL1W4tQ47UuCzt9l2hYnxSWqjjgFxdbaIqfFld50='
WHERE
key_id = '9b73d5cd839e1c6caa9ffc2759af99cb434d2954951044b69d77632c7251990f'
AND (
token = 'uzIOL1W4tQ47UuCzt9l2hYnxSWqjjgFxdbaIqfFld50='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)