UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LzqYkH/ANJvKH8bnZCYNY5K1s6mB3kcZxvRFAkSXKiw='
WHERE
key_id = 'eebd4ff3c60a97f8d62cbbbb630235aefe8fc33836b41cc57cb24f634649c2c3'
AND (
token = 'LzqYkH/ANJvKH8bnZCYNY5K1s6mB3kcZxvRFAkSXKiw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)