UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6KNPylJClAx6bNjO7zXS+R8XlZAX00k6Qk5IvwLvbxI='
WHERE
key_id = '73b34688e24fb5422cbb19044797549fd7695d40f847d9620d221a45c24d447b'
AND (
token = '6KNPylJClAx6bNjO7zXS+R8XlZAX00k6Qk5IvwLvbxI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)