UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3hT+23h3wMlsqryGK6HJwfT7aocB+I8XXG9C/4wJdBI='
WHERE
key_id = '291eedbed4ddff602cf1e037fe1a7a17de8635f2ac99ad44be58832370b7138d'
AND (
token = '3hT+23h3wMlsqryGK6HJwfT7aocB+I8XXG9C/4wJdBI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)