UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zJbkhFJjzRbvTzeDgxUCI7APtjNBwM3N/CRUGXJgMo4='
WHERE
key_id = '45ea6e274aeb82ae60802d62fd34ff0c262533ad28c3536dfc58c55c86be8ef1'
AND (
token = 'zJbkhFJjzRbvTzeDgxUCI7APtjNBwM3N/CRUGXJgMo4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)