UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/xQ5hi2tL6k3Ao8Xz/2tLMX2OJ422+qx3+m8oYSxjyg='
WHERE
key_id = '99414c06e8891f18d5094e39c715a89a0811394db71983c79437be071ccdd6fd'
AND (
token = '/xQ5hi2tL6k3Ao8Xz/2tLMX2OJ422+qx3+m8oYSxjyg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)