UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'N/HL4jAvVM00Zt/OVlzTb0jd0hTsEwc2Xdg+iWnC/C0='
WHERE
key_id = '7ac9a97c33e7c4ea31c6993275ef96a6ef574947368f4c8007e0502e032ee9db'
AND (
token = 'N/HL4jAvVM00Zt/OVlzTb0jd0hTsEwc2Xdg+iWnC/C0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)