UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZFBab74MZkuD7x4EUdgknVwn9QQ9eYR1gwvA7SO37zg='
WHERE
key_id = 'c2bce7babc04826f08c7ab7712f6c19e1286c01e42957445243e1a4e0cbdc631'
AND (
token = 'ZFBab74MZkuD7x4EUdgknVwn9QQ9eYR1gwvA7SO37zg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)