UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+bb5m3BKuRyR87XbSiuRw7DAD0usUzF5hG9Y/folxS0='
WHERE
key_id = 'a1ac825a49d6928c0d2007aa1e3b1410aa404b2a6af3ce2d474b17a64bb594c9'
AND (
token = '+bb5m3BKuRyR87XbSiuRw7DAD0usUzF5hG9Y/folxS0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)