UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Xg64Hoilsw9ozy7k4iTgtl+FXk9ohjAXVVFVK78LhQY='
WHERE
key_id = '72dde3ce8b2c1c58255471eb749b2345997a6a85fbbf826d4ef2627acbb63fa4'
AND (
token = 'Xg64Hoilsw9ozy7k4iTgtl+FXk9ohjAXVVFVK78LhQY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)