UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'a9aDaGTR3ArRvY6fCsdFES4idw7LKd85ee4pIblA//A='
WHERE
key_id = '259f47c5fca4e2b11f71da62d95dfd89ee5784af42cf746c10fcf9e2af88d5cb'
AND (
token = 'a9aDaGTR3ArRvY6fCsdFES4idw7LKd85ee4pIblA//A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)