UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vgn31WPcWDcSo8RvHGPS4K3jVm6rYnlWdj1rT9etsz4='
WHERE
key_id = '2acd37284717ae5304188b298df0e2df584e814a49c042b6fa7ee2e9c3c6b4f6'
AND (
token = 'vgn31WPcWDcSo8RvHGPS4K3jVm6rYnlWdj1rT9etsz4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)