UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/vL+XVHuIewLrH66sgqiKKHONBeX90WPNikPut+36iM='
WHERE
key_id = 'cccb54494f3d933cb4cc33c019e22b7042fac76504a1bcbb81f731037cd91397'
AND (
token = '/vL+XVHuIewLrH66sgqiKKHONBeX90WPNikPut+36iM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)