UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ArsP8nxeP1MJQAA3x2MZm+XpjT/rW+tKrRa3CWuWL8A='
WHERE
key_id = 'f3c6babc07a680da31008c73a5931d0505cb42a8c0731d31db0a7b95c2335d6a'
AND (
token = 'ArsP8nxeP1MJQAA3x2MZm+XpjT/rW+tKrRa3CWuWL8A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)