UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oIZ+DMS9fPJI3BKIzS1NW1EkGu5CYS/B7yk1WRV6OYU='
WHERE
key_id = 'bf80bc9cee067ed237422d3d85d285390587c7dcba7b5a1a2d51bd979dc7fd82'
AND (
token = 'oIZ+DMS9fPJI3BKIzS1NW1EkGu5CYS/B7yk1WRV6OYU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)