UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2Q73u7/hd3mL5CjU5mtvGawsELxzFB4T45AKpfK4ZiE='
WHERE
key_id = '29d1fa8042edc283ec00a97d00d7b081b829f5f66aa050fb6005398d56b90a9e'
AND (
token = '2Q73u7/hd3mL5CjU5mtvGawsELxzFB4T45AKpfK4ZiE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)