UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9HBBTUBjPzXWFXQySBSrjbZjhlZ8d+ZjFVj/Or7wVXw='
WHERE
key_id = 'a6c8d1b9868a1deb458e8d5a3afcf0511ddcaf7d56d4e4444b930c394cdd0155'
AND (
token = '9HBBTUBjPzXWFXQySBSrjbZjhlZ8d+ZjFVj/Or7wVXw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)