UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7MnSyKr9zT9b8+vlXqNEzqkyA+kS3fSUC0I16mv5JB8='
WHERE
key_id = '00e3099a3361bda4415e7b8fa7a878d099f91d47f2e6c6c5ccdbfe4315cfe134'
AND (
token = '7MnSyKr9zT9b8+vlXqNEzqkyA+kS3fSUC0I16mv5JB8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)