UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kxeuPRg2xeMZZLh+5RuYRwfDGkjDeYK7U84iyTrxhVc='
WHERE
key_id = 'cde80d36c46c518b3acbea1f5d5fe400f9d7cebe53365ccdb4a00ca5f8adbee9'
AND (
token = 'kxeuPRg2xeMZZLh+5RuYRwfDGkjDeYK7U84iyTrxhVc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)