UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xtoEyYnvnh2k8rTZ2sZri2ODK0Bash+lv5hY0XwEC8w='
WHERE
key_id = '3b7fcaf3bc7cb7af04d0f40ad663b73b2cb09c34b6970c3a635f967cd2653a33'
AND (
token = 'xtoEyYnvnh2k8rTZ2sZri2ODK0Bash+lv5hY0XwEC8w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)