UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JztHQ4o6dVHOMw7wbOkvBeozY4KWDgxDEYlnHb2kM5I='
WHERE
key_id = '6440ea1798622cef03d27b253e7fe42f78927c89926e1d98cf3b6fea2102c964'
AND (
token = 'JztHQ4o6dVHOMw7wbOkvBeozY4KWDgxDEYlnHb2kM5I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)