UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1aNHqpmBYS6Wq0LbKtrMrU/XVjOnyesGK9c9xD6VeXM='
WHERE
key_id = 'a67aaf0a4ff711f2ab709db141141f1be6b073b394f5ae7bb0c66d241c7beffb'
AND (
token = '1aNHqpmBYS6Wq0LbKtrMrU/XVjOnyesGK9c9xD6VeXM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)