UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HxZtT4aUWnQQW+uoO7BtterWW3llXbeIQ/pEkjxvz5M='
WHERE
key_id = '25ec8aaea43a1b759c79551ac435faf32c4a2122e5b0156c478534138607759b'
AND (
token = 'HxZtT4aUWnQQW+uoO7BtterWW3llXbeIQ/pEkjxvz5M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)